package com.zhj.mvc.controller;

import com.zhj.mvc.domain.Order;
import com.zhj.mvc.service.OrderService;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

import javax.annotation.Resource;

/**
 * 测试接口
 *
 * @author zhonghaijun
 * @version 1.0.0
 * @email "mailto:iamxiaohaijun@gmail.com"
 * @date 2023.06.28 10:29
 * @since 1.0.0
 */
@RestController
@RequestMapping("/test")
public class TestController {

    /** Order service */
    @Resource
    private OrderService orderService;

    /**
     * Test
     *
     * @param json json
     * @return the boolean
     * @since 1.0.0
     */
    @PostMapping("add")
    public boolean test(@RequestBody String json) {
        System.out.println(json);
        return true;
    }

    /**
     * Get
     *
     * @return the list
     * @since 1.0.0
     */
    @GetMapping
    public List<Order> get() {
        return orderService.selectList();
    }

}
